package com.example.kotlindemo.basic

class Study(
    name: String,
    age: Int,
    userId: Int,
    val studyId: Int,
    var course: String
) : Person(name, age, userId), Runnable {
    // 次构造函数
    constructor(studyId: Int, course: String) : this("Unknown", 0, 0, studyId, course)

    // 自定义方法 sing
    fun sing():String {
        return "Study $name is singing, course: $course"
    }

    // 重写 say 方法
    override fun say(): String {
        return "I am a student, name: $name, age: $age, studyId: $studyId, course: $course"
    }

    // 实现接口方法 run
    override fun run() :String {
       return  "Student $name is running, studying $course"
    }
}